export default {
	data() {
		return {
			// imgBaseUrl: 'http://36.133.17.78:801',
			imgBaseUrl: 'https://www.csxgw.com',
		}
	},
	methods: {
		get_wx_code(callback) {
			uni.login({
				provider: 'weixin',
				onlyAuthorize: true,
				success: loginRes => {
					callback && callback(loginRes.code)
				}
			});
		},
		get_wx_openid(code, callback) {
			this.$u.api.getOpenId(code).then(res => {
				console.log(res);
				callback && callback(res)
				// uni.setStorageSync('OPEN_ID', res.openid);
			});
		},
		link_to_page(url, type = 'navigateTo') {
			if (type == 'navigateTo') {
				uni.navigateTo({
					url
				});
			} else if (type == 'reLaunch') {
				uni.reLaunch({
					url
				});
			} else {
				uni.navigateTo({
					url
				});
			}
		}
	}
}
